//ybzuo
//2010.03
//UI compote mgr
//the base compote ,only for gameplaying
#pragma once
#include "i_UIcompote_mgr.h"
#include <map>
class compote_mgr:public i_UIcompote_mgr
{
	public:
		//single
		static compote_mgr& single();
		//get ptr
		compote_mgr* get_ptr();
		//add compote
		bool add_compote(std::string _name,i_UIcompote* _compote);
		//render
		void render();
		//update
		void update();
		//
		void on_message(ILTMessage_Read * _read_msg);
		//remove compote
		bool remove_compote(std::string _name);
    
		void build_compotes(i_UIcompote_maker* _maker);

		void set_window_size(int _w,int _h){m_window_w=_w;m_window_h=_h;}

			
		~compote_mgr();
	private:
		compote_mgr();
		typedef std::map<std::string,i_UIcompote*> CompoteColl;
		typedef std::map<std::string,i_UIcompote*>::iterator CompoteCollIt;
		//coll of all compotos
		CompoteColl m_compotos;

		int m_window_w;
		int m_window_h;

};